<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js和jQuery插件案例</title>
</head>
<body>
<p class="test2">jQuery测试插件2的测试内容</p>
<p>空白</p>
<p>空白</p>
<p class="test2">jQuery测试插件2的测试内容</p>
<p>空白</p>
<p class="test3">js测试插件3的测试内容</p>

</body>
<script type="text/javascript" src="../../../assets/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery.test1.js"></script>
<script type="text/javascript" src="jquery.test2.js"></script>
<script type="text/javascript" src="js.test3.js"></script>
<script>
    $.test1();

    //调用者覆盖 插件暴露的共公方法
    $.fn.test2.format = function (txt) {
        return "<em>" + txt + "</em>"
    };
    $('.test2').test2({
        color: '#fff'
    }).hide(300).show(300);

    var myTest3 = new test3('.test3');
    myTest3.setBg('pink');
</script>
</html>